# Contributor: Duane Hughes <duanejevon@gmail.com
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lockfile-progs
pkgver=0.1.18
pkgrel=1
pkgdesc="Programs for locking and unlocking files and mailboxes"
url="https://packages.debian.org/sid/lockfile-progs"
arch="all"
license="GPL-2.0-only"
makedepends="liblockfile-dev"
subpackages="$pkgname-doc"
source="http://ftp.debian.org/debian/pool/main/l/lockfile-progs/lockfile-progs_$pkgver.tar.gz"

prepare() {
	cd "$builddir"
	# allow us to verride CFLAGS by using 'CFLAGS ?= ...' instead of
	# 'CFLAGS := ...' in the Makefile
	sed -i -e '/^CFLAGS/s/:=/?=/' Makefile
}

build() {
	cd "$builddir"
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"

	install -d "$pkgdir"/usr/bin
	install -d "$pkgdir"/usr/share/man
	install -m 755 "$builddir"/bin/* "$pkgdir"/usr/bin
	install -m 644 "$builddir"/man/* "$pkgdir"/usr/share/man
}

sha512sums="08ef12fd6d586a43b390ead013aa7401beeda68e1d681b3d168d36530e383de8f10c8f9f53fec281f02ef39290b64b0abb9f543fde7b30061204523e6e8ec6e3  lockfile-progs_0.1.18.tar.gz"
